<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var oImg = new Image();
      oImg.onload = function () {
        var imgDiv = document.getElementById("img");
        console.log(this);
        imgDiv.appendChild(this); //this指代img标签
      };
      oImg.src =
        "https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1537409620&di=7bc1f9c5b5d29fd76ecec3893c8e6b8f&src=http://file29.mafengwo.net/M00/7B/34/wKgBpVYdGOiAS71LAABuKaLQB_887.groupinfo.w600.jpeg";
    </script>
  </body>
</html>
